using System;
using System.Collections.Generic;
using RMH.DataAccess;
using RMH.Entities;

namespace RMH.Services
{     
    public class StayService : BaseRepositoryBackedService<Stay, IStayRepository>, IStayService
    {
        private readonly IPatientRepository patientRepository;

        public StayService(IStayRepository stayRepository, IPatientRepository patientRepository) : base(stayRepository)
        {
            this.patientRepository = patientRepository;
        }

        public IList<Stay> GetCurrent()
        {
            return _repository.GetCurrentStays();
        }

		public IList<Stay> GetByDateRange(System.DateTime start, System.DateTime end) {
			return _repository.GetByDateRange(start, end);
		}

        public Stay GetNewStayForPatient(int patientId)
        {
            var patient = patientRepository.GetByID(patientId);
            Stay stay = new Stay();
            stay.Patient = patient;
            return stay;
        }
    }
}